cmake_minimum_required(VERSION 3.10)
project(vulkan-render)

SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_BUILD_TYPE Release)

# set include and lib dirs
IF (WIN32)
    # setup for windows
    SET(GLFW3_INCLUDE_DIR "D:/Libs/glfw/include/")
    SET(GLFW3_LIBRARY "D:/Libs/glfw/lib/glfw3.lib")
    
    SET(STBIMAGE_INCLUDE_DIR "D:/Libs/stb_image/include")
    SET(TINYOBJLOADER_INCLUDE_DIR "D:/Libs/tinyobjloader/include")

    SET(GLM_INCLUDE_DIR "D:/Libs/glm/include")
    SET(GLI_INCLUDE_DIR "D:/Libs/gli/include")

    SET(VK_INCLUDE_DIR "C:/VulkanSDK/1.3.268.0/Include")
    SET(VK_LIBRARY 
        # "C:/VulkanSDK/1.3.268.0/Lib/vulkan-1.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/OSDependentd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/MachineIndependentd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/GenericCodeGend.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/glslangd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/SPIRVd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/SPIRV-Toolsd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/SPIRV-Tools-optd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/glslang-default-resource-limitsd.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/spirv-cross-cored.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/spirv-cross-glsld.lib"
        "C:/VulkanSDK/1.3.268.0/Lib/spirv-cross-reflectd.lib"
        )

    SET(VMA_INCLUDE_DIR "D:/Libs/VulkanMemoryAllocator/include")
    SET(VMA_LIBRARY "D:/Libs/VulkanMemoryAllocator/libs/Debug/VulkanMemoryAllocatord.lib")

    # SET(FREETYPE_INCLUDE_DIR "D:/Libs/freetype/include/")
    # SET(FREETYPE_LIBRARY "D:/Libs/freetype/lib/freetype.lib")

    SET(GLTFSDK_INCLUDE_DIR "D:/Libs/GLTFSDK/Inc/")
    SET(GLTFSDK_LIBRARY "D:/Libs/GLTFSDK/Debug/GLTFSDK/GLTFSDK.lib")

    SET(DLSS_INCLUDE_DIR "D:/Libs/DLSS/include/")
    SET(DLSS_LIBRARY 
        "D:/Libs/DLSS/lib/Windows_x86_64/vs2013/nvsdk_ngx_s.lib"
    )

    SET(SOURCE_INCLUDE_DIR 
        "${PROJECT_SOURCE_DIR}/src"
        "${PROJECT_SOURCE_DIR}/src/ext/"
        "${PROJECT_SOURCE_DIR}/src/ext/imgui/"
    )
    
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATIONS)
ELSE ()
    # Linux

ENDIF (WIN32)

FILE(GLOB_RECURSE SOURCE_CPP_FILES 
    "${PROJECT_SOURCE_DIR}/src/*.c"
    "${PROJECT_SOURCE_DIR}/src/*.cpp")
FILE(GLOB_RECURSE HEADER_FILES 
    "${PROJECT_SOURCE_DIR}/src/*.h"
    "${PROJECT_SOURCE_DIR}/src/*.hpp")

ADD_EXECUTABLE(
    vk_render
    ${SOURCE_CPP_FILES} 
    ${HEADER_FILES}
)

TARGET_INCLUDE_DIRECTORIES(
    vk_render PRIVATE
    ${VK_INCLUDE_DIR}
    ${VOLK_INCLUDE_DIR}
    ${SOURCE_INCLUDE_DIR}
    ${GLFW3_INCLUDE_DIR}
    ${STBIMAGE_INCLUDE_DIR}
    ${GLM_INCLUDE_DIR}
    ${GLI_INCLUDE_DIR}
    ${VMA_INCLUDE_DIR}
    ${GLTFSDK_INCLUDE_DIR}
    ${TINYOBJLOADER_INCLUDE_DIR}
    # ${FREETYPE_INCLUDE_DIR}
)

TARGET_LINK_LIBRARIES(
    vk_render
    ${VK_LIBRARY}
    ${GLFW3_LIBRARY}
    # ${FREETYPE_LIBRARY}
    ${VMA_LIBRARY}
    ${GLTFSDK_LIBRARY}
)
